#include <tenacitas_distributed/on_going_call.h>


using namespace tenacitas;


// #############################################################################
// on_going_calls

// -----------------------------------------------------------------------------
on_going_calls::position
on_going_calls::
add( on_going_calls::on_going_call_ptr & p_on_going_call ) {
    // protecting shared memory
    boost::mutex::scoped_lock lock(m_mutex);

    // adding the @p on_going_call pointer
    m_list.push_back( p_on_going_call_ptr );

    // where is the end?
    position l_ite = m_list.end( );

    // the just added @p on_going_call pointer is one position before the end
    --l_ite;
    
    return l_ite;        
}

